home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / TECHNICA / AUTOCAD / H108.ZIP / CHWIDTH.ZIP / CHPWID.LSP
Lisp/Scheme  |  1991-09-10  |  1KB  |  39 lines

  1. ; CHWIDTH.LSP,  1991  Tony Tanzillo
  2. ;
  3. ; Adds the CHWIDTH command to AutoCAD, which changes the width of a
  4. ; selected group of 2D polylines to a new specified value.
  5. ;
  6. ; Load file with (load"filename"), where "filename" is the name you
  7. ; give to this file, on your disk.
  8.  
  9.    (defun C:CHWIDTH ( / ss e d i j w1 w2)
  10.       (princ "\nSelect polyline(s) to edit,")
  11.       (cond
  12.          (  (not (setq ss (ssget))))
  13.          (t (initget 5)
  14.             (setq w1 (getdist "\nNew width for all polylines: ")
  15.                   j  0
  16.                   w1 (cons 40 w1)
  17.                   w2 (cons 41 (cdr w1)))
  18.             (repeat (setq i (sslength ss))
  19.                (cond
  20.                   (  (and (setq e (ssname ss (setq i (1- i))))
  21.                           (setq d (entget e))
  22.                           (eq (get 0 d) "POLYLINE")
  23.                           (zerop (logand 88 (get 70 d))))
  24.                      (setq j (1+ j))
  25.                      (entmod (subst w1 (assoc 40 d)
  26.                                        (subst w2 (assoc 41 d) d))))))
  27.             (princ (strcat "\nChanged "
  28.                            (itoa j)
  29.                            " polylines." ))))
  30.       (princ)
  31.    )
  32.  
  33.    (defun get (k l)
  34.       (cdr (assoc k l))
  35.    )
  36.  
  37.    ; --------------------------eof chwidth.lsp-------------------------
  38.  
  39.